package org.dse.beans;

import java.util.HashSet;
import java.util.Set;

import org.dse.beans.KeywordIndex;

/**
 * This class represents the htmldocument table in the database. It is used as
 * an O-R mapping bean.
 * 
 * The fields in the class are corresponding with the column in database table.
 * Like url, title, pagerank. The methods are only setters and getters.
 * 
 * @author zhangchen
 * 
 */
public class HtmlDocument implements java.io.Serializable {

	private static final long serialVersionUID = -9056028832236455735L;

	// Fields
	private Integer docIndexId;

	private Integer docOffset;

	private Integer docLength;

	private String docUrl;

	private String rawFileName;

	private Double pagerank;

	private String title;

	private String text;
	
	private String mimeType;

	private Set<KeywordIndex> keywordindexes = new HashSet<KeywordIndex>(0);

	private Set<Webgraph> webgraphs = new HashSet<Webgraph>(0);

	// Property accessors
	/**
	 * Get the docIndexId.
	 * 
	 * @return an integer representing the id
	 */
	public Integer getDocIndexId() {
		return this.docIndexId;
	}

	/**
	 * Set the docIndexId.
	 * 
	 * @param docIndexId
	 *            the value to be set
	 */
	public void setDocIndexId(Integer docIndexId) {
		this.docIndexId = docIndexId;
	}

	/**
	 * Get the docOffset.
	 * 
	 * @return an integer representing the offset in the raw files
	 */
	public Integer getDocOffset() {
		return this.docOffset;
	}

	/**
	 * Set the docOffset.
	 * 
	 * @param docOffset
	 *            the value to be set
	 */
	public void setDocOffset(Integer docOffset) {
		this.docOffset = docOffset;
	}

	/**
	 * Get the docLength.
	 * 
	 * @return an integer representing the length without tag
	 */
	public Integer getDocLength() {
		return this.docLength;
	}

	/**
	 * Set the docLength.
	 * 
	 * @param docLength
	 *            the value to be set
	 */
	public void setDocLength(Integer docLength) {
		this.docLength = docLength;
	}

	/**
	 * Get the docUrl.
	 * 
	 * @return a string representing the url
	 */
	public String getDocUrl() {
		return this.docUrl;
	}

	/**
	 * Set the docUrl.
	 * 
	 * @param docUrl
	 *            the value to be set
	 */
	public void setDocUrl(String docUrl) {
		this.docUrl = docUrl;
	}

	/**
	 * Get the rawFileName.
	 * 
	 * @return a string representing the raw file name
	 */
	public String getRawFileName() {
		return this.rawFileName;
	}

	/**
	 * Set the rawFileName.
	 * 
	 * @param rawFileName
	 *            the value to be set
	 */
	public void setRawFileName(String rawFileName) {
		this.rawFileName = rawFileName;
	}

	/**
	 * Get the pagerank.
	 * 
	 * @return a double representing the pagerank
	 */
	public Double getPagerank() {
		return this.pagerank;
	}

	/**
	 * Set the pagerank.
	 * 
	 * @param pagerank
	 *            the value to be set
	 */
	public void setPagerank(Double pagerank) {
		this.pagerank = pagerank;
	}

	/**
	 * Get the title.
	 * 
	 * @return a string representing the title
	 */
	public String getTitle() {
		return this.title;
	}

	/**
	 * Set the title.
	 * 
	 * @param title
	 *            the value to be set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Get the text.
	 * 
	 * @return a string representing the plain text
	 */
	public String getText() {
		return this.text;
	}

	/**
	 * Set the text.
	 * 
	 * @param text
	 *            the value to be set
	 */
	public void setText(String text) {
		this.text = text;
	}
	
	/**
	 * Get the mime type.
	 * 
	 * @return a string representing the mime type
	 */
	public String getMimeType() {
		return this.mimeType;
	}

	/**
	 * Set the mime type.
	 * 
	 * @param mimeType
	 *            the value to be set
	 */
	public void setMimeType(String mimeType) {
		this.mimeType = mimeType;
	}

	/**
	 * Get the keyword indexes associated with the document.
	 * 
	 * @return a Set containing all the keyword indexes
	 */
	public Set<KeywordIndex> getKeywordindexes() {
		return this.keywordindexes;
	}

	/**
	 * Set the keyword indexes.
	 * 
	 * @param keywordindexes
	 *            the set to be set
	 */
	public void setKeywordindexes(Set<KeywordIndex> keywordindexes) {
		this.keywordindexes = keywordindexes;
	}

	/**
	 * Get the web graph records associated with the document.
	 * 
	 * @return a Set containing all the web graph records
	 */
	public Set<Webgraph> getWebgraphs() {
		return this.webgraphs;
	}

	/**
	 * Set the web graph records.
	 * 
	 * @param webgraphs
	 *            the set to be set
	 */
	public void setWebgraphs(Set<Webgraph> webgraphs) {
		this.webgraphs = webgraphs;
	}
}